package com.lyf.lottery.enums;

import com.lyf.common.utils.SpringContextHolder;
import com.lyf.cache.redisson.IRedisDelayQueueEnum;
import com.lyf.cache.redisson.IRedisDelayQueueExecutor;

/**
 * @author Lin
 * @date 2023/2/19
 */
public enum RedisDelayQueueEnum implements IRedisDelayQueueEnum {
    /**
     * 延时队列
     */
    TEST("TEST", "延时队列测试", SpringContextHolder.getBeanOfClass(TestDelayQueueExecutor.class)),
    ;

    String code;
    String name;
    IRedisDelayQueueExecutor executor;

    RedisDelayQueueEnum(String code, String name, IRedisDelayQueueExecutor executor) {
        this.code = code;
        this.name = name;
        this.executor = executor;
    }

    @Override
    public String getCode() {
        return code;
    }

    @Override
    public String getName() {
        return name;
    }

    @Override
    public IRedisDelayQueueExecutor getExecutor() {
        return executor;
    }}
